package com.kim.useroauth.common.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "PhoneCodeDTO", description = "手机号获取验证码DTO")
public class PhoneCodeDTO {

    @NotBlank(message = "电话号为空")
    @Pattern(regexp = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$")
    @Size(max = 11,message = "电话号长度11位")
    @ApiModelProperty(value = "电话号",required = true)
    private String phone;

}
